/**
 * LoadingHelper
 */

  var LoadingHelper = (function (){
      var src = "/static/new_version/image/loading.svg";
      var loading = [
          "<div class='loading-wrap'>",
              "<div class='loading-content'>",
                  "<img src='" + src + "' />",
                  "<span>请求中,请稍候...</span>",
              "</div>",
          "</div>"
      ];

      var init = function (){
          loading = $(loading.join("")).appendTo($("body"));
      };

      var show = function (){
          loading.show();
      };

      var hide = function (){
          loading.hide();
      };

      var destroy = function (){
          loading.remove();
          loading = null;
      };

      init();

      return {
          show: show,
          hide: hide,
          destroy: destroy
      }
  })();

  module.exports = LoadingHelper;
